<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>7.数组的filter方法</title>
	</head>
	<body>
		<script type="text/javascript" >
			let arr = [
				{name:'榴莲',price:100},
				{name:'草莓',price:30},
				{name:'西瓜',price:10},
			]

			//正常写法
			/* const result = arr.filter((item,index)=>{
				return item.price > 30
			}) */

			const result = arr.filter(item => item.price > 30)
			console.log(result)
		</script>
	</body>
</html>